<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Manyou's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet"/>
<script src="<?=SITE_URL?>js/editor/kindeditor.js" type="text/javascript"></script>
<script type="text/javascript">

function show_share(a){
    if(a==1){
        document.getElementById("share").style.display='none';
    }else{
        document.getElementById("share").style.display='block';
    }
    }
function show_share1(a){
    if(a==1){
        document.getElementById("share1").style.display='none';
    }else{
        document.getElementById("share1").style.display='block';
    }
}
function sch_tc2(i){
  	if (i==1){
  		document.getElementById('sch2').style.display = 'block';
      	document.getElementById('sch1').style.display = 'none';
  		document.getElementById('daily2').style.display = 'block';
      	document.getElementById('daily1').style.display = 'none';
      	show_share1(1);
  	}else{
 		document.getElementById('sch1').style.display = 'block';
      	document.getElementById('sch2').style.display = 'none';
 		document.getElementById('daily1').style.display = 'block';
      	document.getElementById('daily2').style.display = 'none';
      	show_share(1);
  	}
}
</script>

</head>
<body>
<div id="append">
</div>
<div class="container">

        <? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><div class="mainbox nomargin">
<div class="hastabmenu">
                <ul class="tabmenu">
                    <li><a href="index.php?admin_line/edit/<?=$lid?>">第一步：编辑描述</a> </li>
                    <li><a href="index.php?admin_line/editprice/<?=$lid?>">第二步：编辑价格</a></li>
                    <li class="tabcurrent"><a href="index.php?admin_line/editday/<?=$lid?>">第三步：编辑行程</a></li>
                    <li><a href="index.php?admin_line/editdesc/<?=$lid?>">第四步：编辑指南</a></li>
                </ul><div class="tabcontentcur"></div>
        </div>


<form action="index.php?admin_line/editday" method="post" name="modiform" id="modiform">
<div class="tese">
<dl>
<dt>
<b>线路特色：</b><em>&nbsp;</em><br /><span>400个字以内</span><br /><span>
</span></dt><dd><textarea id="features" name="features" class="textarea textarea100" cols="" rows=""><?=$ds['descs']?></textarea>
</dd>
</dl>
</div>

<div class="form_form">

<dl>
<dt><b>行程安排：</b><em>*</em></dt>
<dd><div class="new"></div>
<label title="推荐使用此模式发布行程，欣欣即将推出多种模版美化行程"><input type="radio" name="sch_tc" value="1" onclick="sch_tc2(1);" <? if((int)$ds['type']==1) { ?>checked<? } ?> />按天编辑模式</label> 
<label><input type="radio" name="sch_tc" value="0" onclick="sch_tc2(0);" <? if((int)$ds['type']==0) { ?>checked<? } ?> />可视化编辑模式</label>



<div id="daily1" class="daily" style="display:<? if((int)$ds['type']==0) { ?>block<? } else { ?>none<? } ?>">
<h5>请填写具体行程安排，不要填写费用说明、联系方式及非行程相关的信息</h5>

</div>	



<div id="daily2" class="daily" style="display:<? if((int)$ds['type']==1) { ?>block<? } else { ?>none<? } ?>">
<h5>推荐使用按天编辑</h5>
</div>

</dd>
</dl>

<table id="sch1" class="travel_day" style="display:<? if((int)$ds['type']==0) { ?>block<? } else { ?>none<? } ?>">
    <tr>
      <td align="center">
      <textarea id="mycontent" style="height:400px;width:760px;" name="content"><?=$ds['content']?></textarea>
   	  </td>
    </tr>
</table>

<span id="sch2" class="travel_day" style="display:<? if((int)$ds['type']==1) { ?>block<? } else { ?>none<? } ?>">

<div id="xingcheng-box">
<input type="hidden" name="att[xingcheng_format]" value="0" />
    <div class="fieldset xingcheng-by-day">
<?=$dstr?>
</div>
<!--div class="add_day"><a href="#?" onclick="xingcheng_add_day();return false;">+ 添加第<b id="xingcheng-next-day-no">2</b>天行程</a></div-->
<span id="sch_day"></span>	
</div>
<input type="hidden" id="xing_day" name="xing_day" value="1" />
<script type="text/javascript">
/*
  		//添加行程
function has_css_class_name(elem,cname){
    return(elem&&cname)?new RegExp('\\b'+cname+'\\b').test(elem.className):false;
}
    function xingcheng_add_day(){
    	
var div = document.getElementById('xingcheng-box');

var i,days=0;
var last_set_node = null;
var ds = div.getElementsByTagName('DIV');

for(i=0;ds.length && i<ds.length;i++){
    var node = ds[i];
    if(has_css_class_name(node,'xingcheng-by-day')){
days++;
last_set_node = node;
    }
}

var node = document.createElement('div');
node.className='fileset xingcheng-by-day';
node.innerHTML = '<dl>'
+'<dt><b>第'+(days+1)+'天：</b><em>&nbsp;</em></dt><dd><input type="text" class="text text380" maxlength="30" name="att[xingcheng]['+days+'][0]" value=""/> <a id="remove_day'+(days+1)+'" href="#" onclick="xingcheng_remove_day();return false;">删除</a></dd>'
+'</dl>'
+'<dl>'
+'<dt>行程内容：<em>&nbsp;</em></dt>'
  +'<dd><textarea name="att[xingcheng]['+days+'][1]" style="width:520px;" rows="12"></textarea>'
  	+'<a href="#" onclick="var t=this.parentNode.getElementsByTagName(\'textarea\')[0];t.rows=t.rows+5;return false;" title="增加输入框的高度">+行数</a>'
  		+'<a href="#" onclick="var t=this.parentNode.getElementsByTagName(\'textarea\')[0];t.rows=Math.max(5,t.rows-5);return false;" title="减小输入框的高度">-行数</a></dd>'
+'</dl>'
+'<dl>'
+'<dt>用餐：<em>&nbsp;</em></dt><dd>'
+'<label><input name="att[xingcheng]['+days+'][2]" class="checkbox" type="checkbox" value="1" />早餐</label>'
+'<label> <input name="att[xingcheng]['+days+'][3]" type="checkbox" class="checkbox" value="2" />中餐 </label>'
+'<label><input name="att[xingcheng]['+days+'][4]" type="checkbox"  class="checkbox" value="3" />晚餐</label>'
+'</dd>'
+'</dl>'
+'<dl class="hotel">'
+'<dt>住宿：<em>&nbsp;</em></dt><dd><input type="text" class="text text160" name="att[xingcheng]['+days+'][5]" value=""/></dd>'
+'</dl>';

div.insertBefore(node,last_set_node.nextSibling);

document.getElementById('xingcheng-next-day-no').innerHTML = days+2;

if (document.getElementById('remove_day'+document.getElementById("xing_day").value)){
document.getElementById('remove_day'+document.getElementById("xing_day").value).style.display = 'none';
}
document.getElementById("xing_day").value=document.getElementById("xing_day").value*1+1;

document.getElementById('sch_day').innerHTML = '';
    }
    function xingcheng_remove_day()
    {
var div = document.getElementById('xingcheng-box');

var i,days=0;
var last_set_node = null;
var ds = div.getElementsByTagName('div');

for(i=0;ds.length && i<ds.length;i++){
    var node = ds[i];
    if(node.className.indexOf('xingcheng-by-day') > -1){
days++;
last_set_node = node;
    }
}

if(days <= 1) return;
last_set_node.parentNode.removeChild(last_set_node);

document.getElementById('xingcheng-next-day-no').innerHTML = days;

document.getElementById("xing_day").value=document.getElementById("xing_day").value*1-1;
if (document.getElementById('remove_day'+document.getElementById("xing_day").value)){
document.getElementById('remove_day'+document.getElementById("xing_day").value).style.display = '';
}

document.getElementById('sch_day').innerHTML = '';

    }
    xingcheng_add_day();
    	    	xingcheng_add_day();
    	    	xingcheng_add_day();
    	    	xingcheng_add_day();

 */
    </script>  
</span>
<dl><dt>跳转：<em>&nbsp;</em></dt><dd><input type="radio" value="1" name="tz">继续编辑&nbsp;<input type="radio" value="2" name="tz" checked>编辑指南</dd></dl>
<div class="button"><input type="submit" value="确认修改" class="sub"></div>
<div class="clear"></div>

</div>

</div>
<input type="hidden" value="<?=$lid?>" name="lid">
</form>


</div>

<script type="text/javascript">
KE.init({
id : 'mycontent',
resizeMode : 1,
allowUpload : true,
newlineTag : 'br',
imageUploadJson : '<?=$setting['site_url']?>index.php?attach/upload',
items : [
'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'image', 'link']
});
KE.create('mycontent');
</script>
</body>

</html>
